﻿@model MasContact

@{
    ViewBag.Title = "เพิ่มข้อมูล ผู้ขาย";
    ViewBag.Descr = "เพิ่มข้อมูลผู้ขายที่ใช้งานในระบบ";
    Layout = ViewBag.Layout;
    bool noLayout = ViewBag.NoLayout == true;
}

@using (Html.BeginForm("Create", "MasContact", FormMethod.Post, new { id="form1", @class = "form-horizontal" }))
{
    @Html.AntiForgeryToken()

    <div class="block-button-menu-above">
        @Html.ActionLink("กลับไปหน้าแสดงข้อมูลทั้งหมด", "Index", new { category = Model.ConCategory, noLayout = noLayout }
            , new { @class="btn btn-small btn-gray button-standard-width", role="button" })
        @Html.ButtonSubmit()
    </div>
    
    <div class="alert-error">@Html.ValidationSummary()</div>
    
    @Html.Partial("_EditorForm")

}

@section scripts
{
    <script>
        $(function () {
            $("#form1").submit(function (e) {
                e.preventDefault();
                var currentForm = this;
                bootbox.confirm(function (result) {
                    if (result) {
                        currentForm.submit();
                    }
                });
            }); 
            $(".chzn-select").chosen({ width: '220px' });
        });
    </script>
}